package com.business_clean.ui.adapter.custom.contact;

import com.business_clean.R;
import com.business_clean.app.weight.CustomAvatarView;
import com.business_clean.data.mode.contact.ContactListEntity;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import org.jetbrains.annotations.NotNull;

public class ContactManagerAdapter extends BaseQuickAdapter<ContactListEntity, BaseViewHolder> {

    public ContactManagerAdapter() {
        super(R.layout.item_contact_manager);
        addChildClickViewIds(R.id.tv_item_contact_edit, R.id.tv_item_contact_del);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder holder, ContactListEntity item) {
        holder.setText(R.id.tv_item_contact_name, item.getPerson_name())
                .setText(R.id.tv_item_contact_phone, item.getPerson_mobile())
                .setText(R.id.tv_item_contact_post, item.getJob_name());

        CustomAvatarView customAvatarView = holder.getView(R.id.iv_item_contact_avatar);
        customAvatarView.setAvatar("", item.getPerson_name());
        customAvatarView.getAvatarText().setTextSize(16f);

    }
}
